home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Learn Microsoft Visual Basic 6.0 Now
/
Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO
/
media
/
chap09
/
b09a005.cc2
< prev
next >
Wrap
Text File
|
1998-06-07
|
1KB
|
34 lines
0, As you write longer programs, you're
2, likely to have several forms and event
4, procedures that use the same variables and
6, routines. By default, variables are local
10, to an event procedure, meaning that
12, they can be read or changed only in the
14, procedure that they were created in. In
17, this chapter, you will sidestep this safety
19, feature by creating a special file
22, called a standard module for the variables
24, and procedures you want to share
26, throughout your program. First, you'll learn how
30, to create a new standard module in a
32, Visual Basic project. Standard modules
35, appear in the Project window and are stored
37, on disk as separate files with a .bas
40, extension. Next, you'll learn how to
44, create public variables that can be changed
46, by any procedure in your program. By
49, default, Visual Basic variables are local
51, in scope. But if you declare them in a
53, standard module with the Public keyword,
56, they can be used anywhere. Finally,
60, you'll learn how to create your own Function
61, and Sub procedures to extend the Visual
64, Basic language. Function and Sub
66, procedures assign a familiar name to a block of
68, code you plan to use periodically as
71, your program runs. Because they eliminate
73, duplication, Function and Sub procedures
76, are especially efficient in larger
78, programming projects and team development
80, efforts.
82, END